import { postForm, get, put } from '@/utils/request'

export function getDataRecords(listQuery) {
  return get('/dict/data/list/page', listQuery)
}

export function getDatasByType(dictType) {
  return get('/dict/data/list', { dictType: dictType })
}

export function add(optData) {
  return postForm('/dict/data', optData)
}

export function edit(optData) {
  optData['pkId'] = optData.dictCode
  return put('/dict/data', optData)
}

export function del(ids) {
  return postForm('/dict/data/del', { pkId: ids[0] })
}

export default { add, edit, del }
